package com.brillilab.service.core.crm.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.brillilab.dao.mapper.crm.PublicMethodRelateReagentMapper;
import com.brillilab.domain.crm.kitRelateMethod.po.PublicMethodRelateReagent;
import com.brillilab.service.core.crm.IPublicMethodRelateReagentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wuzhiyu
 * @Title: PublicMethodRelateReagentServiceImpl
 * @ProjectName brill_lab
 * @Description: TODO
 * @date 2019/5/309:42
 */
@Service
@Transactional
public class PublicMethodRelateReagentServiceImpl implements IPublicMethodRelateReagentService {
    @Resource
    private PublicMethodRelateReagentMapper publicMethodRelateReagentMapper;
    @Override
    public boolean saveRelateReagent(PublicMethodRelateReagent relateReagent) {
        return publicMethodRelateReagentMapper.insert(relateReagent)>0;
    }

    @Override
    public List<PublicMethodRelateReagent> getPublicMethodRelateReagentListByMethodId(Long methodId) {
        LambdaQueryWrapper<PublicMethodRelateReagent> query = new LambdaQueryWrapper<>();
        query.eq(PublicMethodRelateReagent::getMethodId,methodId);
        return publicMethodRelateReagentMapper.selectList(query);
    }
}
